package person.tavion.securitydemo.core.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.BeanIds;
import person.tavion.securitydemo.TestBean;

//@Configuration
public class TestConfiguration {

    @ConditionalOnMissingBean(name = BeanIds.SPRING_SECURITY_FILTER_CHAIN)
    @Bean
    public TestBean get(ApplicationContext applicationContext){
        Object bean = applicationContext.getBean(BeanIds.SPRING_SECURITY_FILTER_CHAIN);

        System.out.println(1);
        return new TestBean();
    }
}
